/**
 * @param {string[]} messages
 * @param {string[]} senders
 * @return {string}
 */
 var largestWordCount = function(messages, senders) {
  const mp = new Map()
  for(let i = 0; i<senders.length; i++) {
    mp.set(senders[i], ~~mp.get(senders[i]) + messages[i].split(' ').length)
  }
  const cnt = new Map()
  let z = -1
  for(const [k, v] of mp) {
    if(!cnt.has(v)) cnt.set(v, [])
    cnt.get(v).push(k)
    z = Math.max(z, v)
  }
  return cnt.get(z).sort()[cnt.get(z).length-1]
};